package com.bjpowernode;

import com.bjpowernode.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/*
    依赖注入
 */
public class SpringTest02 {
    public static void main(String[] args) {
        //创建spring容器
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");

        UserService userService = (UserService)context.getBean("userServiceImpl");
        userService.addUser();
    }
}
